import React, { FC, Suspense, lazy } from 'react';
import { useRoutes } from 'react-router-dom';
import Home from './view/Home';
// import App from "./App";
// import About from "./view/About";
const App = lazy(() => import('./App'));
const About = lazy(() => import('./view/About'));

const Router: FC = () => {
  const routers = useRoutes([
    {
      path: '/',
      element: <App />,
      children: [
        {
          index: true,
          element: <Home />,
        },
        {
          path: 'about',
          element: <About />,
        },
      ],
    },
  ]);
  return routers;
};

export default Router;
